﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using ExpressHelps.Model;
using ExpressHelps.DAL;

namespace ExpressHelps.BLL.Task
{
    public static class TaskFactorys
    {
        public static void ProduceTask(Tasks.TaskType taskType, string description, string address, int money)
        {
            Tasks task = null;
            switch (taskType)
            {
                case Tasks.TaskType.Delivery:
                    task = new DeliveryTask(description, address, money);
                    //将其插入数据库中
                    TaskRepository.SaveTask(task);
                    break;
                case Tasks.TaskType.Takeout:
                    task = new TakeoutTask(description, address, money);
                    break;
                default:
                    break;
            }
        }
    }
}
